package com.summer.serialization;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class DemoTest {

	public static void main(String[] args) throws IOException, Exception {

		ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("test.serial"));
		Person p = new Person("工匠若水", 27);
		oos.writeObject(p);
		oos.close();
		@SuppressWarnings("resource")
		ObjectInputStream ois = new ObjectInputStream(new FileInputStream("test.serial"));
		System.out.println(((AdapterBean) ois.readObject()).toString());

	}
}